const togo = function(url,data,type){
	let urls = `/pages/${url}/${url}`
	console.log(urls)
	url = urls
	url += (url.indexOf('?') < 0 ? '?' : '&') + param(data)
	if(type == 'switchTab'){
		uni.switchTab({
			url
		})
	}else if (type == 'redirectTo'){
		uni.redirectTo({
			url
		})
	}else if(type == 'reLaunch'){
		uni.reLaunch({
			url
		})
	}else{
		uni.navigateTo({
			url
		}) 
	}
}
 
export function param(data) {
  let url = ''
  for (var k in data) {
    let value = data[k] !== undefined ? data[k] : ''
    url += '&' + k + '=' + encodeURIComponent(value)
  }
  return url ? url.substring(1) : ''
}

 function development(){
	uni.showToast({
		icon:'none',
		title:'正在开发中...'
	})
} 
 
export {togo,development}